Skip to content

feat(backend): add Docker support for self-hosting#349

Open
joaoclaudio82 wants to merge 1 commit into
stats-organization:masterfrom
joaoclaudio82:feat/docker-support
Open

feat(backend): add Docker support for self-hosting#349
joaoclaudio82 wants to merge 1 commit into
stats-organization:masterfrom
joaoclaudio82:feat/docker-support

Conversation

@joaoclaudio82

Copy link
Copy Markdown

Add a multi-stage Dockerfile that runs the backend as an HTTP server (apps/backend/express.js), so cards can be served outside Vercel. The image builds the core package, produces a production-only bundle via 'pnpm deploy', and runs as a non-root user with a healthcheck against /api/status/up.

  • Promote express to a runtime dependency and add a 'start' script, since HTTP-server mode needs express at runtime.
  • Add .dockerignore, docker-compose.yml (with an optional Postgres profile) and docs/docker.md.
  • Postgres stays optional: without POSTGRES_URL the app renders cards with no database.
  • Structure leaves room for a future static-SVG generation mode.

Closes #287

Add a multi-stage Dockerfile that runs the backend as an HTTP server
(apps/backend/express.js), so cards can be served outside Vercel. The
image builds the core package, produces a production-only bundle via
'pnpm deploy', and runs as a non-root user with a healthcheck against
/api/status/up.

- Promote express to a runtime dependency and add a 'start' script,
  since HTTP-server mode needs express at runtime.
- Add .dockerignore, docker-compose.yml (with an optional Postgres
  profile) and docs/docker.md.
- Postgres stays optional: without POSTGRES_URL the app renders cards
  with no database.
- Structure leaves room for a future static-SVG generation mode.

Closes stats-organization#287
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

@joaoclaudio82 is attempting to deploy a commit to the martin-mfg's projects Team on Vercel.

A member of the Team first needs to authorize it.

@joaoclaudio82

Copy link
Copy Markdown
Author

This PR addresses #287 by adding a container image that runs the backend as an HTTP server, so the cards can be served outside Vercel.

A few notes for reviewers:

  • The Postgres dependency is optional. Without POSTGRES_URL the app renders cards with no database, so the image works standalone with just a PAT_* token.
  • express was moved from devDependencies to dependencies since HTTP-server mode needs it at runtime, and the lockfile was regenerated to match.
  • The build stages are structured so a future static-SVG generation mode can be added as an alternative command without reworking them.

I've run docker build and the container locally against a token and confirmed the /api routes respond. Happy to adjust anything the review turns up. The failing Vercel checks look like the standard fork authorization gate rather than a code issue, but let me know if I've missed something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Plan: Adding Docker Support

1 participant